package com.qn.service.impl;

import com.qn.dao.EmailContentDao;
import com.qn.entity.EmailContent;
import com.qn.service.EmailContentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Emailcontent)表服务实现类
 *
 * @author ph
 * @since 2021-05-11 14:21:59
 */
@Service("emailcontentService")
public class EmailContentServiceImpl implements EmailContentService {
    @Resource
    private EmailContentDao emailcontentDao;

    /**
     * 新增数据
     *
     * @param emailcontent 实例对象
     * @return 实例对象
     */
    @Override
    public Integer insert(EmailContent emailcontent) {
        return this.emailcontentDao.insert(emailcontent);
    }


    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.emailcontentDao.deleteById(id) > 0;
    }

    @Override
    public List<EmailContent> getEmailTemplate(Integer id) {
        return this.emailcontentDao.getEmailTemplate(id);
    }

}